package com.example.blog.util.UserUtils;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
@Component
public class RandomUserId {

    /**
     * 根据时间戳生成唯一id
     */
    public String randomId() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSS");
        String id = sdf.format(System.currentTimeMillis());
        return id;
    }

}
